package com.ibuonline.b2b.entity;

import java.io.Serializable;

public class CompanyNews implements Serializable {

	private static final long serialVersionUID = -4179917681400301762L;

	//fields
	private java.lang.Integer id;
	private java.lang.Integer companyId;
	private java.lang.String title;
	private java.lang.String content;
	private java.lang.String description;
	private java.lang.String keywords;
	private java.lang.String display;
	private java.lang.String pic;
	private java.lang.Integer viewCount;
	private java.lang.String status;
	private java.sql.Timestamp publishDate;
	private java.sql.Timestamp lastupdate;

	//default constructor
	public CompanyNews() {
	}

	//getter
	public java.lang.Integer getId() {
		return id;
	}
	public java.lang.Integer getCompanyId() {
		return companyId;
	}
	public java.lang.String getTitle() {
		return title;
	}
	public java.lang.String getContent() {
		return content;
	}
	public java.lang.String getDescription() {
		return description;
	}
	public java.lang.String getKeywords() {
		return keywords;
	}
	public java.lang.String getDisplay() {
		return display;
	}
	public java.lang.String getPic() {
		return pic;
	}
	public java.lang.Integer getViewCount() {
		return viewCount;
	}
	public java.lang.String getStatus() {
		return status;
	}
	public java.sql.Timestamp getPublishDate() {
		return publishDate;
	}
	public java.sql.Timestamp getLastupdate() {
		return lastupdate;
	}

	//setter
	public void setId(java.lang.Integer id) {
		this.id = id;
	}
	public void setCompanyId(java.lang.Integer companyId) {
		this.companyId = companyId;
	}
	public void setTitle(java.lang.String title) {
		this.title = title;
	}
	public void setContent(java.lang.String content) {
		this.content = content;
	}
	public void setDescription(java.lang.String description) {
		this.description = description;
	}
	public void setKeywords(java.lang.String keywords) {
		this.keywords = keywords;
	}
	public void setDisplay(java.lang.String display) {
		this.display = display;
	}
	public void setPic(java.lang.String pic) {
		this.pic = pic;
	}
	public void setViewCount(java.lang.Integer viewCount) {
		this.viewCount = viewCount;
	}
	public void setStatus(java.lang.String status) {
		this.status = status;
	}
	public void setPublishDate(java.sql.Timestamp publishDate) {
		this.publishDate = publishDate;
	}
	public void setLastupdate(java.sql.Timestamp lastupdate) {
		this.lastupdate = lastupdate;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof CompanyNews))
			return false;

		final CompanyNews companyNews = (CompanyNews)other;
		if (!this.id.equals(companyNews.getId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(id).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("CompanyNews[")
			.append("id=").append(id).append(", ")
			.append("companyId=").append(companyId).append(", ")
			.append("title=").append(title).append(", ")
			.append("content=").append(content).append(", ")
			.append("description=").append(description).append(", ")
			.append("keywords=").append(keywords).append(", ")
			.append("display=").append(display).append(", ")
			.append("pic=").append(pic).append(", ")
			.append("viewCount=").append(viewCount).append(", ")
			.append("status=").append(status).append(", ")
			.append("publishDate=").append(publishDate).append(", ")
			.append("lastupdate=").append(lastupdate).append("]").toString();
	}

	///###############################
	public String getDisplayName() {
		if (display != null)
			return com.ibuonline.b2b.common.SysCache.getOptionName("Display", display);
		return null;
	}
	
	private String companyName;
	public String getCompanyName() {
		return companyName;
	}
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	
}
